<?php

use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;

class CreateUserLevelsTable extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::create('user_levels', function (Blueprint $table) {
            $table->increments('level_id')->comment('主键');
            $table->string('name', 20)->comment('等级名称');
            $table->integer('auto_increase')->comment('自动升级')->default(1);
            $table->integer('next_level_id')->comment('下一等级ID');
            $table->integer('need_credits')->comment('所需积分数量')->default(100);
            $table->timestamps();
        });
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        Schema::dropIfExists('user_levels');
    }
}
